<template>
  <LayoutContainer>
    <div>
      <h2>{{ $t('cycle') }}</h2>
      <UiFormEdition
          :model="Cycle"
          :go-back-route="goBackRoute"
      >
        <template v-slot="{ entity }">
          <UiInputText
              field="label"
              v-model="entity.label"
              :rules="rules()"
          />
        </template>
      </UiFormEdition>
    </div>
  </LayoutContainer>
</template>
<script setup lang="ts">
import {RouteLocationPathRaw} from 'vue-router'
import { useI18n } from 'vue-i18n'
import Cycle from "~/models/Education/Cycle";

const i18n = useI18n()

const goBackRoute = { path: `/parameters`, query: { tab: 'teaching' } }

const rules = () => [
  (label: string | null) => (label !== null && label.length > 0) || i18n.t('please_enter_a_value'),
]
</script>
